package bairui.international.console.web.controller.advance.category;

import com.lianjing.sh.spring.web.controller.enhance.module.Module;
import com.lianjing.sh.spring.web.controller.enhance.module.ModuleHead;
import com.lianjing.sh.spring.web.controller.enhance.module.body.AddModuleBody;

/**
 *
 * Module_Add
 *
 */
class Module_Add{


	public Module module(
		bairui.international.model.domain.jpa.TB_ProductCategory bean
		,
		C_Advance_Category_Add_Add.Add.Operate c_Advance_Category_Add_Add_Add_Operate

		,com.lianjing.sh.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors

	){
		return this.moduleTemplate(
				bean
				,
				c_Advance_Category_Add_Add_Add_Operate

				,editors
			);
	}

	public Module module(
		java.util.List<bairui.international.model.domain.jpa.TB_ProductCategory> bean
		,
		C_Advance_Category_Add_Add.Add.Operate c_Advance_Category_Add_Add_Add_Operate

		,com.lianjing.sh.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors

	){
		return this.moduleTemplate(
				bean
				,
				c_Advance_Category_Add_Add_Add_Operate

				,editors
			);
	}

	public Module module(
	//	,
	C_Advance_Category_Add_Add.Add.Operate c_Advance_Category_Add_Add_Add_Operate

	,com.lianjing.sh.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors

	){
		Object bean = null;
		return this.moduleTemplate(
				bean
				,
				c_Advance_Category_Add_Add_Add_Operate

				,editors
			);
	}

	/**
	 * 编辑模块
	 */
	private Module moduleTemplate(
		Object bean
		,
		C_Advance_Category_Add_Add.Add.Operate c_Advance_Category_Add_Add_Add_Operate

		,com.lianjing.sh.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors

	){
		return
			new Module(
					new ModuleHead("添加")
					,
					new AddModuleBody(
							bean,
							Model.class,
							c_Advance_Category_Add_Add_Add_Operate,
							Relation.relations(
								)
							,editors
						)
				);
	}

	/**
	 * 输入模型
	 */
	static public class Models {
		private @lombok.Getter @lombok.Setter java.util.List<Model> models = new java.util.ArrayList<>();
	}

	@org.springframework.stereotype.Component("bairui.international.console.web.controller.advance.category.Module_Add$Model")

	static public class Model

	 extends bairui.international.model.domain.jpa.TB_ProductCategory

	 implements

		com.lianjing.sh.spring.web.controller.enhance.input.InputModelable

	{



		/**

		 * 默认构造函数

		 */

		public Model(){}



		/**

		 * 构造函数

		 */

		public Model(

			bairui.international.model.domain.jpa.TB_ProductCategory bean

		){

			if(null != bean){

				this.setName(bean.getName());

				this.setNumber(bean.getNumber());

			}

		}





		@com.lianjing.sh.model.common.annotation.Comment("名称")

		@com.sh_lianjing.reflect.method.annotation.MethodOrder(1001)

		@org.hibernate.validator.constraints.NotBlank

		@javax.validation.constraints.Size(min=0, max=100)

		@Override

		public String getName() {

			return (String)super.getName();

		}





		@com.lianjing.sh.model.common.annotation.Comment("代码")

		@com.sh_lianjing.reflect.method.annotation.MethodOrder(2001)

		@org.hibernate.validator.constraints.NotBlank

		@javax.validation.constraints.Size(min=0, max=100)

		@Override

		public String getNumber() {

			return (String)super.getNumber();

		}





		/**

		 * 非继承属性

		 */



		/**

		 * 得到输入属性

		 */

		/** 得到名称 */

		public String gainName() {

			return this.getName();

		}

		/** 得到代码 */

		public String gainNumber() {

			return this.getNumber();

		}



		/**

		 * 转换到表单数据格式

		 */

		public java.util.Map<String, String> toFormData() throws com.sh_lianjing.serialize.json.jackson.exception.JsonException{

			return com.lianjing.sh.web.common.util.Util_Form.beanToFormDataFormat(this);

		}



	}



	static public class Relation
	{
		public static java.util.Map<String, java.util.List<?>> relations(
		){
			java.util.Map<String, java.util.List<?>> map = new java.util.HashMap<>();
			return map;
		}
	}



	/**
	 * 输出模型
	 */


}
